from django.db import models

# Create your models here.
from django.db import models
# 导入时间域
from django.utils import timezone


# 创建打卡时间基类
# 基类
# class Base(models.Model):
#     # 创建时间
#     create_time = models.DateTimeField(default=timezone.now, null=True)
#
#     class Meta:
#         abstract = True


# 创建一张部门分类表
class Department(models.Model):
    name = models.CharField(max_length=200, blank=True, null=True)
    sid = models.ForeignKey('self', models.DO_NOTHING, db_column='sid', blank=True, null=True)

    class Meta:
        db_table = 'department'


# 员工表
class Peoples(models.Model):
    name = models.CharField(max_length=200, blank=True, null=True)
    fen = models.FloatField(blank=True, null=True)
    did = models.IntegerField(blank=True, null=True)
    is_work = models.IntegerField(blank=True, null=True)
    upgrade = models.IntegerField(blank=True, null=True)

    class Meta:
        db_table = 'peoples'


# 打卡记录表

class Card(models.Model):
    name = models.CharField(max_length=20, null=True)
    push_time = models.DateTimeField(blank=True, null=True)
    work_time = models.DateTimeField(blank=True, null=True)
    off_tiem = models.DateTimeField(blank=True, null=True)
    fen = models.CharField(max_length=20, blank=True, null=True)

    class Meta:
        db_table = 'card'


# --------------------关于商场------------------
# 用户表
class MylearnUser(models.Model):
    uid = models.IntegerField(null=True)
    username = models.CharField(max_length=50, null=True)
    phone = models.CharField(max_length=15, null=True)

    class Meta:
        db_table = 'mylearnuser'

# 产品表
class MylearnGoods(models.Model):
    gid = models.IntegerField(null=True)
    title = models.CharField(max_length=100, null=True)
    img = models.CharField(max_length=200, null=True)
    price = models.IntegerField(null=True)
    vip_price = models.IntegerField(null=True)

    class Meta:
        db_table = 'mylearngoods'


# 订单表
class MylearnIndent(models.Model):
    uid = models.IntegerField(null=True)
    title = models.CharField(max_length=100, null=True)
    price = models.IntegerField(null=True)
    username = models.CharField(max_length=50, null=True)
    phone = models.CharField(max_length=15, null=True)

    class Meta:
        db_table = 'mylearnindent'


# -----------------------关于医美平台-------------------------------
class CosmeticsGood(models.Model):
    gid = models.IntegerField(null=True)
    name = models.CharField(max_length=20, null=True)
    price = models.IntegerField(null=True)
    num = models.IntegerField(null=True)

    class Meta:
        db_table = 'cosmeticsgood'


# 用户购买记录，订单表
class CosmeticsHistory(models.Model):
    cid = models.IntegerField(null=True)
    name = models.CharField(max_length=20, null=True)
    goods = models.CharField(max_length=20, null=True)
    money = models.IntegerField(null=True)

    class Meta:
        db_table = 'cosmeticshistory'


class CosmeticsUser(models.Model):
    name = models.CharField(max_length=200, null=True)
    password = models.CharField(max_length=200, null=True)
    money_full = models.IntegerField(null=True)
    #赠品
    is_gift = models.IntegerField(null=True)
    money = models.CharField(max_length=200, null=True)

    class Meta:
        db_table = 'cosmeticsuser'

# -------理发店--------------------------------------
class LifaUser(models.Model):
    username = models.CharField(max_length=50,null=True)
    userprice=models.IntegerField(default=0)
    password=models.CharField(max_length=10,null=True)
    vipuser=models.IntegerField(default=0)
    class Meta:
        db_table='lifauser'


class LifaGoods(models.Model):
    title=models.CharField(max_length=20,null=True)
    price=models.IntegerField(null=True)
    name=models.CharField(max_length=10,null=True)
    vipprice=models.IntegerField(null=True)
    class Meta:
        db_table='lifagoods'
